package main

import (
	"encoding/json"
	"fmt"
)

type Person struct {
	ID        int
	FirstName string `json:"name"`
	LastName  string
	Address   string `json:"address,omitempty"` //忽略
}
type Employee struct {
	Person
	ManagerID int
}
type Contractor struct {
	Person
	CompanyID int
}

func main() {
	employees := []Employee{
		{
			Person: Person{
				LastName:  "Doe",
				FirstName: "Jerry",
			},
		},
		{
			Person: Person{
				LastName:  "bob",
				FirstName: "marry",
			},
		},
	}
	data, _ := json.Marshal(employees)
	fmt.Printf("%s\n", data)
}
